package com.bidepan.service;


import com.bidepan.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service

public class UserServiceImpl implements UserService{
    //注入Dao
    @Autowired   //根据UserDao类型找到其实现类UserDaoImpl再注入到下面的userDao中
    //若有两个以上类型相同的bean则需使用Qualifier指定注入哪个bean
    @Qualifier("userRedisDaoImpl")
    private UserDao userDao;

    @Override
    public void addUserService() {
        System.out.println("UserService接口里面的方法执行了");
        //调用注入后的userDao的方法
        userDao.addUserDao();
    }
}
